package cn.vihub.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.vihub.mapper.ShopRoleToMenuMapper;
import cn.vihub.pojo.ShopRoleToMenu;
import cn.vihub.service.ShopRoleToMenuService;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: 秋晚
 * @Date:  2025/7/18 16:14
 * @Description: 
 **/

@Service
@Transactional(rollbackFor = Exception.class)
public class ShopRoleToMenuServiceImpl extends ServiceImpl<ShopRoleToMenuMapper, ShopRoleToMenu> implements ShopRoleToMenuService{

    @Override
    public Boolean removebyRoleId(Integer roleId) {
        return remove(new LambdaQueryWrapper<ShopRoleToMenu>().eq(ShopRoleToMenu::getRoleId,roleId));
    }

    @Override
    public List<ShopRoleToMenu> isMenuByRoleIds(List<Integer> roleIds) {
        return list(new LambdaQueryWrapper<ShopRoleToMenu>().in(ShopRoleToMenu::getRoleId,roleIds));
    }
}
